<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include  file="/jsps/front/common/taglibs.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>修改密码</title>    
	
	
	<link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/application.css"></c:url>">
    <link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/form.css"></c:url>">
	<script type="text/javascript" src="<c:url value="/js/common.js"/>"></script>

	<style>
	  .notice_1 {
			DISPLAY: none; 
			FLOAT: left; 
			COLOR: #666; 
			PADDING-TOP: 5px;
		}
		.notice_ok {
			MARGIN-TOP: 4px; 
			DISPLAY: none; 
			FLOAT: left; 
			WIDTH: 15px; 
			HEIGHT: 11px
		}
		.notice_error {
			BORDER: #c6a263 1px solid; 
			MARGIN-TOP: 2px; 
			DISPLAY: none; 
			PADDING-LEFT: 3px; 
			FLOAT: left;        
            COLOR: #c30; 
            PADDING-TOP: 1px;  
            HEIGHT: 16px; 
            BACKGROUND-COLOR: #fff2bc;
            font-size:13px;
		}
	</style>

	<script type="text/javascript">
	function $(id){
        	return document.getElementById(id);
        };
        function $F(id){
	        var o=$(id);
	        return o.value;
        };
		function check_password_focus(){
			    $('password_ok').style.display="none";
			    $('passwordValidMsg').className="notice_1";
			    $('passwordValidMsg').style.display="inline";
			    $('passwordValidMsg').innerHTML="密码可由大小写英文字母、数字组成，长度6－20个字符。";
			
			}
			function txtPassword_check(){
			    var password = $F('custPwd');
			    $('passwordValidMsg').style.display="inline";
			    $('passwordValidMsg').innerHTML="密码可由大小写英文字母、数字组成，长度6－20个字符。";
			    $('password_ok').style.display="none";
			    
			    if(password=='')
			    {
			        $('passwordValidMsg').className="notice_error";
			        $('passwordValidMsg').innerHTML="此项为必填项，请输入您的密码。";
			        $('txtPassword').className="input_text_error";
			        return false;
			    }
			    
			    if(password.length<6||password.length>20){
			        $('passwordValidMsg').className="notice_error";
			        $('passwordValidMsg').innerHTML="密码格式错误，请用大小写英文字母、数字，长度6－20个字符。";
			        $('txtPassword').className="input_text_error";
			        return false;    
			    }
			        
			    $('passwordValidMsg').style.display="none";    
			    $('passwordValidMsg').innerHTML='';
			    $('password_ok').style.display="inline";
		    
			    return true;
			    
			}
			/*再次填写密码*/
			function check_repassword_focus(){
			    $('repassword_ok').style.display="none";
			    $('repeatPassValidMsg').style.display="none";
			}
			
		   function txtRepeatPass_check(){
			    var rep_password = $F('confirmCustPwd');
			    $('repeatPassValidMsg').style.display="inline";
			    $('repeatPassValidMsg').innerHTML='';
			     $('repassword_ok').style.display="none";
			   
			    if(rep_password=='')
			    {
			        $('repeatPassValidMsg').style.display="inline";
			        $('repeatPassValidMsg').className="notice_error";    
			        $('repeatPassValidMsg').innerHTML="此项为必填项，请再次输入您的密码。";
			        $('txtRepeatPass').className="input_text_error";
			        return false;
			    }
			    
			    if(rep_password!=$F('custPwd'))
			    {
			        $('repeatPassValidMsg').style.display="inline";
			        $('repeatPassValidMsg').className="notice_error";
			        $('repeatPassValidMsg').innerHTML="两次密码输入不一致，请重新填写。";
			        $('txtRepeatPass').className="input_text_error";
			        return false;
			    }
			    
			    if(txtPassword_check()){
				    $('repeatPassValidMsg').style.display="none";    
				    $('repeatPassValidMsg').innerHTML='';
				    $('repassword_ok').style.display="inline";
				    checkRepassword=true;
			    }else{
				    $('repeatPassValidMsg').style.display="none";
				    $('repeatPassValidMsg').innerHTML='';
				    $('repassword_ok').style.display="none";
			    }
			    
			    return true;
			    }
	</script>

  </head>
  
  <body style="background:url(../images/tanchuye.jpg) no-repeat">
 <c:if test="${not empty message}">
       <script type="text/javascript">
          alert('${message}');
       </script>
    </c:if>
    <form action="<c:url value="/securityMgr?act=myNewInfo"/>" method="post" onclick="">
      <input type="hidden" name="act" value="modifymyinfo">
      <div>
            <span class="lableFont">昵称：</span>
			<input type="text" class="text" name="name" value="${loginedCustomer.userName}" />
     </div>
     <div>
            <SPAN class=span_n>设定密码：</SPAN>
							<INPUT class=input_text 
							       id=custPwd   
							       type=password 
							       onblur="this.className='input_text';txtPassword_check()"
								   onfocus="this.className='input_text input_text_over';check_password_focus();"
							       maxLength=20 
							       name=custPwd> 
							<P id=passwordValidMsg style="font-size:13px;"></P>
							<IMG class=notice_ok id=password_ok title=填写正确 src="<c:url value="/jsps/front/images/reg/write_ok.gif"/>"> 
       </div>
       <div>
           <SPAN class=span_n>再输一次密码：</SPAN>
							<INPUT class=input_text 
							       id=confirmCustPwd 
							       type=password
                                   onblur="this.className='input_text';txtRepeatPass_check()"
								   onfocus="this.className='input_text input_text_over';check_repassword_focus();"
							       maxLength=20 
							       name=confirmCustPwd> 
							<P id=repeatPassValidMsg style="font-size:13px;"></P>
							<IMG class=notice_ok id=repassword_ok title=填写正确 src="<c:url value="/jsps/front/images/reg/write_ok.gif"/>">
      </div>
      <div class="submitDiv">
        <input type="submit" value="保存"/>
        <input type="submit" value="重写"/>
      </div>
    </form>
  </body>
</html>
